//
//  CoreDataManager.h
//  coreData
//
//  Created by 葱花思鸡蛋 on 2018/5/2.
//  Copyright © 2018年 hangzhouzhulongkeji. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
#import "Student+CoreDataProperties.h"
@interface CoreDataManager : NSObject
// 放在.H 文件中，增删改查时让外部进行调用
@property(nonatomic,strong)NSManagedObjectContext *context;
+ (instancetype)shareManager;

- (BOOL)insertDataWithEntityName:(NSString *)entityName andDictionary:(NSDictionary *)dict;
- (NSArray *)selectRecordWithEntityName:(NSString *)entityName andPredicateString:(NSString *)predicateString andSortWithKeyArr:(NSArray *)sortKeyArr andAscending:(BOOL)ascending;
- (BOOL)deleteDataWithEntityName:(NSString *)entityName predicateString:(NSString *)predicateString;
- (BOOL)updateRecordWithEntityName:(NSString *)entityName andPredicateString:(NSString *)predicateString andSetAttributeDict:(NSDictionary*)dict;
@end
